Platform Explorer / Nuxeo Platform 2021.63

Component org.nuxeo.salesforce.SalesforceComponent

Documentation

A service to configure remote a remote Nuxeo Salesforce application connecting to this Nuxeo instance.

Resolution Order

854
The resolution order represents the order in which this component has been resolved by the Nuxeo Runtime framework.
You can influence this order by adding "require" tags in your component declaration, to make sure it is resolved after another component.

Start Order

943
The start order represents the order in which this component has been started by the Nuxeo Runtime framework.
This number is interesting to tweak if your Java component interacts with other components, and needs to be started before or after another one.
It can be changed by implementing the method "Component#getApplicationStartedOrder()" on your Java component: components are sorted according to this reference value, in increasing order.
The default value is 1000, and the repository initialization uses number 100. Negative values can also be used.

Implementation

Class: org.nuxeo.salesforce.SalesforceComponent

Services

Extension Points

Contributions

XML Source

<?xml version="1.0"?>

<component name="org.nuxeo.salesforce.SalesforceComponent" version="1.0">
  <documentation>
  A service to configure remote a remote Nuxeo Salesforce application connecting to this Nuxeo instance. 
  </documentation>

  <implementation class="org.nuxeo.salesforce.SalesforceComponent"/>

  <service>
	  <provide interface="org.nuxeo.salesforce.SalesforceComponent" />
  </service>

  <extension-point name="config">
    <documentation>Configure the library app</documentation>
    <object class="org.nuxeo.salesforce.config.LibraryAppConfigDescriptor"/>
    <object class="org.nuxeo.salesforce.config.DocListAppConfigDescriptor"/>
    <object class="org.nuxeo.salesforce.config.SearchAppConfigDescriptor"/>
  </extension-point>

  <extension target="org.nuxeo.ecm.core.operation.OperationServiceComponent" point="operations">
    <operation class="org.nuxeo.salesforce.config.SalesforceConfigProvider" />
    <operation class="org.nuxeo.salesforce.config.SalesforceValidateConnection" />
    <operation class="org.nuxeo.salesforce.operations.LinkDocument" />
  </extension>
  <extension target="org.nuxeo.ecm.automation.server.AutomationServer" point="bindings">
    <binding name="Salesforce.ConfigProvider"></binding>
    <binding name="Salesforce.ValidateConnection"></binding>
    <binding name="Salesforce.LinkDocument"></binding>
  </extension>

  <extension target="org.nuxeo.ecm.core.io.MarshallerRegistry" point="marshallers">
      <register class="org.nuxeo.salesforce.enrichers.ExternalDownloadURLJsonEnricher" enable="true" />
  </extension>

  <!-- 
  Default configuration. 
  -->
  <extension target="org.nuxeo.salesforce.SalesforceComponent"
      point="config">
      <library>
        <!-- title>Nuxeo Library</title -->
      	<root>/default-domain/workspaces</root>
      	<nuxeo-drive>true</nuxeo-drive>
      	<!-- 
      	you can control the visibility of these columns: type, size, author, lastModified.
      	The default is to hide the type column. 
      	-->
      	<doclist-hidden-columns>type</doclist-hidden-columns>
      	<!--
      	You can control which doc tab, data section, doc action or nav actions are visible. 
      	If not specified or empty all items are visible:
      	<doc-tabs>preview,data,history</doc-tabs>  
      	<data-sections>metadata,business-metadata,attachments,renditions,mlt</data-sections>
      	<doc-actions>edit,open,download,upload,lock</doc-actions>
      	<nav-actions>download,open,edit,delete</nav-actions>
      	The custom nav. actions are added to the built-in nav-actions. You should define a label, a Salesforce icon ID 
      	and an operation to be invoked bny the action 
      	<custom-nav-actions>
      		<action name='myaction' label="My Action" icon="action:new_note" operation="Salesforce.MyAction" />
      		...
      	</custom-nav-actions>
      	
      	To add custom user fields:
        <user-fields>NuxeoUserId__c,Team__c</user-fields>
        
        You can change the default open action to open the document in nuxeo:
        (The default is to open the document in the document viewer on the right of the listing.)   
        <open-doc-in-nuxeo>true</open-doc-in-nuxeo>
        
      	<preview>
      	function(doc) {
      		// the doc object is an instance of the FileDoc class from force-app/main/default/lwc/nuxeoClient/model.js
      		// the doc.doc object is the Nuxeo document defined in nuxeo javascript client.
      		// Refer to FileDoc for more on the API it expose.
      		// You can return null (or falsy) to let the client use the default rendition detection.         		
      		return {
      			viewer: "video" | "audio" | "image" | "pdf" | "html" | "text" | "binary",
      			rendition: renditionId
      			content: xpath
      			type: mime-type // optional mime type - must be specified for videos.
      		}
      	}
      	</preview>
      	 -->
      </library>
      <listing>
        <!-- title>Nuxeo Documents</title -->
      	<nuxeo-drive>true</nuxeo-drive>      	
      	<upload>true</upload>
      	<link-operation>Salesforce.LinkAsSource</link-operation>
      	<link-test>
      	function(doc, recordId) {
            var source = doc.properties['dc:source'];
            return source ? source === recordId || source.split(',').indexOf(recordId) > -1 : false;
      	}
      	</link-test>
      	<!--
      	The query element defines a custom javascript function to be used by the client to create the search call 
      	for the listing and listing search requests.    
      	The context object describe the client context and can be used to compute the page provider or other parameters
      	to pass to the search. The context object contains the following properties: repositoryName, appType, appConfig, 
      	recordId, recordType, record and env. The **env** property is a custom environment object 
      	that can be defined by external components. (by default it is an empty object)
      	
      	Note that we wrap the recordId inside % characters - to be able to use the LIKE operator in the fixed part of the sfdc_linked_docs page provider     
      	 -->
      	<query>
      	function(context, params) {
      		params.pageProvider = "sfdc_linked_docs";
      		params.recordId = '%'+context.recordId+'%';
      	}
      	</query>
      	<!-- 
      	you can control the visibility of these columns: type, size, author, lastModified.
      	The default is to hide the type column. 
      	-->
      	<doclist-hidden-columns>type</doclist-hidden-columns>      	
      </listing>
      <search>
        <!--  title>Nuxeo Search</title -->
        <nuxeo-drive>true</nuxeo-drive>
      	<page-provider>default_search</page-provider>
      </search>
  </extension>

  <!-- default listing page provider -->
  <!-- 
  <extension target="org.nuxeo.ecm.platform.query.api.PageProviderService" point="providers">
  	<coreQueryPageProvider name="sfdc_linked_docs">
  	  <pattern>
      	SELECT * FROM Document WHERE ecm:mixinType != 'HiddenInNavigation'
          AND ecm:isVersion = 0
          AND ecm:isTrashed = 0
          AND dc:source = ? 
      </pattern>
      <quickFilters>
        <quickFilter name="noFolder">
          <clause>ecm:mixinType != 'Folderish'</clause>
        </quickFilter>
      </quickFilters>
      <pageSize>50</pageSize>
    </coreQueryPageProvider>  	
  </extension>
-->
  <extension target="org.nuxeo.ecm.platform.query.api.PageProviderService" point="providers">
  	<coreQueryPageProvider name="sfdc_load_library">
      <whereClause docType="SalesforceSearch">
        <fixedPart>
      	  ecm:mixinType != 'HiddenInNavigation' AND ecm:isVersion = 0 AND ecm:isTrashed = 0
      	</fixedPart>
        <predicate parameter="sf:objectId" operator="=">
          <field schema="salesforce_search" name="recordId" />
        </predicate>
      </whereClause>
      <sort column="dc:created" ascending="false" />      
      <pageSize>50</pageSize>
    </coreQueryPageProvider>  	
  
  	<coreQueryPageProvider name="sfdc_linked_docs">
      <whereClause docType="SalesforceSearch">
        <fixedPart>
      	  ecm:mixinType != 'HiddenInNavigation' AND ecm:isVersion = 0 AND ecm:isTrashed = 0 AND dc:source LIKE :recordId
      	</fixedPart>
        <predicate parameter="ecm:fulltext" operator="FULLTEXT">
          <field schema="salesforce_search" name="ecm_fulltext" />
        </predicate>
      </whereClause>
      <quickFilters>
        <quickFilter name="noFolder">
          <clause>ecm:mixinType != 'Folderish'</clause>
        </quickFilter>
      </quickFilters>
      <!--  sort column="dc:modified" ascending="false" / -->
      <pageSize>50</pageSize>
    </coreQueryPageProvider>  	
  </extension>

  <extension target="org.nuxeo.ecm.core.operation.OperationServiceComponent"
             point="contextHelpers">
    <contextHelper id="Salesforce" class="org.nuxeo.salesforce.SalesforceFunctions"/>
  </extension>

</component>